// 请求拦截器
export const requestInterceptors = () => {
    uni.$uv.http.interceptors.request.use((config) => {
        // 添加token
        const token = uni.getStorageSync('token')
        if (token) {
            config.header = config.header || {}
            config.header['token'] = token
        }

        // 显示加载状态
        uni.showLoading({
            title: '请求中...'
        })

        return config
    }, config => {
        return Promise.reject(config)
    })
}